import http from '@/utils/request'
/**
 * 获取字典
 */
export const getDictByCode = (system,params) => {
  return http.post("/"+system+"/dict/getDicts", params);
};
/**
 * 获取字典列表
 */
export const getDictList = (system,params) => {
  return http.post("/"+system+"/dict/pageQuery", params);
};

/**
 * 根据Id查询字典
 */
export const getDictById = (system,id) => {
  return http.get("/"+system+"/dict/selectById", { id: id });
};

/**
 * 添加字典
 */
export const addDict = (system,params) => {
  return http.post("/"+system+"/dict/insert", params);
};

/**
 * 修改字典
 */
export const updateDict = (system,params) => {
  return http.post("/"+system+"/dict/update", params);
};

/**
 * 删除字典
 */
export const deleteDict = (system,id) => {
  return http.delete("/"+system+"/dict/delete", { id: id });
};

/**
 * 获得枚举字典
 */
export const getEnumDict = (code) => {
  return http.get("/admin/enumDict/getDict",{code: code});
};